home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / c / layoutc.exe / REPORT.C < prev    next >
C/C++ Source or Header  |  1992-01-27  |  4KB  |  72 lines

  1. #include <stdio.h>
  2. main()
  3. {
  4. char time[]="10:00 pm";
  5. char date[]="05/03/91";
  6. char name[]="Lincoln Beach Software";
  7. char address[]="P.O. Box 1554";
  8. char city[]="Ballwin";
  9. char state[]="MO";
  10. char zip[]="63022";
  11. int value=175;
  12.  
  13. //  The code below was generated using LAYOUT.EXE,
  14. //  And imported into this file.
  15. //  The data above was manually created.
  16. //  This will not compile because of the unknown variable
  17. //  On line 57 which is bad_variable.  An error was generated
  18. //  When the report was processed with LAYOUT.  Also line 56
  19. //  Will have an unknown in it because there is a place holder
  20. //  And no value to be placed in it.
  21. //  If you fix these two errors it will compile and you can see
  22. //  The output for yourself.
  23. fprintf(stdprn,"Use To Generate Report Layouts:\n\r");
  24. fprintf(stdprn,"\n\r");
  25. fprintf(stdprn,"%-8s              You Can Line Up Titles Easier               Date: %-8s\n\r",time,date);
  26. fprintf(stdprn,"                    And Set Up Output Without Guessing\n\r");
  27. fprintf(stdprn,"\n\r");
  28. fprintf(stdprn,"Name                    Address               City            State  Zip Code\n\r");
  29. fprintf(stdprn,"======================  ====================  ==============  =====  ===========\n\r");
  30. fprintf(stdprn,"%-22s  %-19s   %-14s   %-2s    %-10s\n\r",name,address,city,state,zip);
  31. fprintf(stdprn,"\n\r");
  32. fprintf(stdprn,"******************************************************************************************************\n\r");
  33. fprintf(stdprn,"\n\r");
  34. fprintf(stdprn,"Or address labels:         %-21s\n\r",name);
  35. fprintf(stdprn,"                           %-19s\n\r",address);
  36. fprintf(stdprn,"                           %-2s, %-2s %-2s\n\r",city,state,zip);
  37. fprintf(stdprn,"\n\r");
  38. fprintf(stdprn,"******************************************************************************************************\n\r");
  39. fprintf(stdprn,"\n\r");
  40. fprintf(stdprn,"And Numbers:\n\r");
  41. fprintf(stdprn,"\n\r");
  42. fprintf(stdprn,"This is a %6X Hex number.\n\r",value);
  43. fprintf(stdprn,"This is a %6d Decimal number.\n\r",value);
  44. fprintf(stdprn,"This is a %6.2f Float Number.\n\r",value/5.5);
  45. fprintf(stdprn,"\n\r");
  46. fprintf(stdprn,"******************************************************************************************************\n\r");
  47. fprintf(stdprn,"\n\r");
  48. fprintf(stdprn,"You Can Use The Percent Sign In Other Ways:\n\r");
  49. fprintf(stdprn,"\n\r");
  50. fprintf(stdprn,"This is a %%/dollar example to show it can be used with something.\n\r");
  51. fprintf(stdprn,"And it can also be used by itself %% .\n\r");
  52. fprintf(stdprn,"\n\r");
  53. fprintf(stdprn,"******************************************************************************************************\n\r");
  54. fprintf(stdprn,"\n\r");
  55. fprintf(stdprn,"You Can Also Prefill %-2s Fields\n\r","Desired");
  56. fprintf(stdprn,"\n\r");
  57. fprintf(stdprn,"******************************************************************************************************\n\r");
  58. fprintf(stdprn,"\n\r");
  59. fprintf(stdprn,"You Can Also Use Characters [%c] & %c.\n\r",'a','b');
  60. fprintf(stdprn,"\n\r");
  61. fprintf(stdprn,"******************************************************************************************************\n\r");
  62. fprintf(stdprn,"It Also Performs A Data Integrity Check:\n\r");
  63. fprintf(stdprn,"\n\r");
  64. fprintf(stdprn,"This %-3s will generate a warning because of no variable.\n\r");
  65. fprintf(stdprn,"And this will generate an error because of no place holder. \n\r",bad_variable);
  66. fprintf(stdprn,"\n\r");
  67.  
  68.  
  69.  
  70. }
  71.  
  72.